/*
 * Lenovo Group
 * Copyright (c) 2015-2016 All Rights Reserved.
 * 
 * Project Name:assign-tracer
 * Create Time: 2016年1月22日 下午4:57:26
 */
package com.lenovo.lmrp.server.assigntracer.util.pusher;

import com.lenovo.sdc.framework.sns.ASMSRequest;

/**
 * @author songyz
 *
 */
public class SMSRequestImpl extends ASMSRequest {

    /**
     * @param contentType
     * @param user
     * @param password
     * @param phone
     * @param content
     */
    public SMSRequestImpl(ContentType contentType, String user, String password, String phone, String content) {
        super(contentType, user, password, phone, content);
        this.addExtHeader("POST", "/webservice/deliverMessage/SmsService.asmx HTTP/1.1");
        this.addExtHeader("Host", "10.99.124.1");
        this.addExtHeader("SOAPAction", "\"http://tempuri.org/SendMessage\"");
    }

    @Override
    public String makeBody() {
        return "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><SendMessage xmlns=\"http://tempuri.org/\"><UserName>"
               + this.getUser() + "</UserName><Password>" + this.getPassword() + "</Password><Mobile>" + this.getPhone()
               + "</Mobile><Contents>" + this.getContent() + "</Contents></SendMessage></soap:Body></soap:Envelope>";
    }

}
